package com.chainyoung.component_tmtrade.ui.mvp.model;

import com.chainyoung.common.integration.IRepositoryManager;
import com.chainyoung.common.mvp.BaseModel;
import com.chainyoung.common.utils.RxUtils;
import com.chainyoung.component_tmtrade.api.TradeService;
import com.chainyoung.component_tmtrade.bean.FiatCoin;
import com.chainyoung.component_tmtrade.ui.mvp.contract.TradeFiatCurrencyMainCurrencyContract;

import java.util.List;

import javax.inject.Inject;

import io.reactivex.Flowable;

public class TradeFiatCurrencyMainModel extends BaseModel implements TradeFiatCurrencyMainCurrencyContract.Model {


    @Inject
    public TradeFiatCurrencyMainModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);
    }

    @Override
    public Flowable<List<FiatCoin>> getFiatCoinList() {
        return mRepositoryManager.obtainRetrofitService(TradeService.class)
                .getFiatCoinList()
                .compose(RxUtils.<List<FiatCoin>>handleResult());
    }
}
